/* 仪表盘专用样式 */

/* 仪表盘容器 */
.dashboard {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    min-height: calc(100vh - 100px);
}

/* 仪表盘头部增强 */
.dashboard-header {
    position: relative;
    margin-bottom: 30px;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}

/* 数据刷新指示器 */
.refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #667eea;
}

.refresh-icon {
    animation: none;
}

.refresh-icon.spinning {
    animation: spin 1s linear infinite;
}

/* 时间范围选择器 */
.time-range-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-range-selector label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* 快速筛选按钮组 */
.quick-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: white;
    color: #495057;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* 高级数据卡片 */
.data-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #f0f0f0;
}

.data-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.data-card.danger {
    border-color: #fee;
}

.data-card.danger::before {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

.data-card.warning {
    border-color: #fff3cd;
}

.data-card.warning::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.data-card.success {
    border-color: #d4edda;
}

.data-card.success::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.card-title-text h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.card-title-text p {
    font-size: 13px;
    color: #6c757d;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.card-action-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* 卡片内容 */
.card-content {
    margin-bottom: 16px;
}

.card-value {
    font-size: 40px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
    margin-bottom: 8px;
}

.card-value.small {
    font-size: 28px;
}

.card-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.card-trend.positive {
    color: #28a745;
}

.card-trend.negative {
    color: #dc3545;
}

.card-trend.neutral {
    color: #6c757d;
}

/* 卡片底部 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.card-footer-text {
    font-size: 12px;
    color: #6c757d;
}

.card-link {
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-link:hover {
    text-decoration: underline;
}

/* 网格布局变体 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.dashboard-grid.col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.dashboard-grid.col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-grid.col-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 大型卡片 */
.large-card {
    grid-column: span 2;
    grid-row: span 1;
}

.full-width-card {
    grid-column: 1 / -1;
}

/* 状态指示标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.critical {
    background-color: #dc3545;
    color: white;
}

.status-badge.warning {
    background-color: #ffc107;
    color: #856404;
}

.status-badge.info {
    background-color: #17a2b8;
    color: white;
}

.status-badge.success {
    background-color: #28a745;
    color: white;
}

.status-badge.normal {
    background-color: #6c757d;
    color: white;
}

/* 迷你图表容器 */
.mini-chart {
    height: 60px;
    margin: 10px 0;
}

/* 数据列表 */
.data-list {
    max-height: 300px;
    overflow-y: auto;
}

.data-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.data-list-item:last-child {
    border-bottom: none;
}

.data-list-label {
    font-size: 14px;
    color: #495057;
}

.data-list-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

/* 仪表盘工具栏 */
.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 日期选择器组 */
.date-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-picker-wrapper label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.date-picker-wrapper input[type="date"],
.date-picker-wrapper input[type="time"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* 视图切换按钮 */
.view-toggle {
    display: flex;
    background-color: white;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.view-toggle-btn {
    padding: 6px 16px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.view-toggle-btn.active {
    background-color: #667eea;
    color: white;
}

/* 刷新间隔选择器 */
.refresh-interval {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-interval label {
    font-size: 14px;
    color: #495057;
}

.refresh-interval select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* 导出按钮 */
.export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background-color: #28a745;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

/* 紧凑模式 */
.dashboard.compact .dashboard-header {
    margin-bottom: 16px;
}

.dashboard.compact .stats-cards,
.dashboard.compact .charts-grid {
    gap: 16px;
}

.dashboard.compact .stat-card,
.dashboard.compact .chart-card {
    padding: 16px;
}

/* 暗黑模式支持 */
.dashboard.dark {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

.dashboard.dark .data-card {
    background-color: #16213e;
    border-color: #0f3460;
}

.dashboard.dark .card-title-text h3 {
    color: #e0e0e0;
}

.dashboard.dark .card-value {
    color: #ffffff;
}

.dashboard.dark .dashboard-toolbar {
    background-color: #16213e;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .dashboard-grid.col-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .large-card {
        grid-column: span 3;
    }
}

@media (max-width: 992px) {
    .dashboard-grid.col-3,
    .dashboard-grid.col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .large-card {
        grid-column: span 2;
    }
    
    .dashboard-toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 16px;
    }
    
    .dashboard-grid,
    .dashboard-grid.col-2,
    .dashboard-grid.col-3,
    .dashboard-grid.col-4 {
        grid-template-columns: 1fr;
    }
    
    .large-card,
    .full-width-card {
        grid-column: span 1;
    }
    
    .card-value {
        font-size: 32px;
    }
    
    .date-picker-group {
        flex-direction: column;
        align-items: stretch;
    }
}